package com.qianli.cashmama.trade.repo.impl;


import com.qianli.cashmama.trade.dao.TBillRepaymentAccountingDao;
import com.qianli.cashmama.trade.domain.model.TradeRepaymentAccounting;
import com.qianli.cashmama.trade.entity.TBillRepaymentAccountingEntity;
import com.qianli.cashmama.trade.repo.BillRepaymentAccountingRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

/**
 * Created with IntelliJ IDEA.
 * User: sm
 * Date: 2017/7/24
 * Time: 上午11:50
 */
@Repository
public class BillRepaymentAccountingRepositoryImpl implements BillRepaymentAccountingRepository {


    @Autowired
    private TBillRepaymentAccountingDao tBillRepaymentAccountingDao;

    @Override
    public void store(TradeRepaymentAccounting tradeRepaymentAccounting) {
        TBillRepaymentAccountingEntity tBillRepaymentAccountingEntity = new TBillRepaymentAccountingEntity()
                .setRepaymentBizNo(tradeRepaymentAccounting.getRepaymentBizNo())
                .setTradeNo(tradeRepaymentAccounting.getTradeNo())
                .setAccountedTime(tradeRepaymentAccounting.getAccountedTime())
                .setBillNo(tradeRepaymentAccounting.getBillNo())
                .setDiscountCapital(tradeRepaymentAccounting.getDiscountCapital())
                .setPaidCapital(tradeRepaymentAccounting.getPaidCapital())
                .setPaidTotalCapital(tradeRepaymentAccounting.getPaidTotalCapital())
                .setRealIncome(tradeRepaymentAccounting.getRealIncome())
                .setRealInterest(tradeRepaymentAccounting.getRealInterest())
                .setRealServiceFee(tradeRepaymentAccounting.getRealServiceFee())
                .setRealOverdueFee(tradeRepaymentAccounting.getRealOverdueFee())
                .setRealOverdueServiceFee(tradeRepaymentAccounting.getRealOverdueServiceFee())
                .setUserCode(tradeRepaymentAccounting.getUserCode())
                .setPayBizNo(tradeRepaymentAccounting.getPayBizNo())
                .setProductCategory(tradeRepaymentAccounting.getProductCategory())
                .setProductCode(tradeRepaymentAccounting.getProductCode());
        tBillRepaymentAccountingDao.insert(tBillRepaymentAccountingEntity);
    }
}
